home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2007 February
/
PCWorld_2007-02_cd.bin
/
domacnost a kancelar
/
avedesk
/
AveDesk13.exe
/
Effects
/
Rotater.effectlet
< prev
next >
Wrap
Text File
|
2004-10-11
|
5KB
|
186 lines
<!--
preamble stuff you might say to someone
willing to open this in a text editor.
-->
<?xml version="1.0" encoding="UTF-8"?>
<effectlet>
<info>
<name>Rotation Effect Script</name>
<author>Yursil Kidwai</author>
<notes><![CDATA[
Credits to Fabien LAMAISON @ KERIN from who i just basically altered the bounce/shake scripts from
]]></notes>
<version>0.0.7</version>
</info>
<settings>
<param name="Debug" type="Boolean" defval="False"/>
</settings>
<preferences>
<preference name="ReturnStart" type="range" defval="1" min="0" max="1">
Return to Starting position on mouse out- 0 is false 1 is true (If left false, eventually there will be a small jitter as it reaches the max rotation, havent spent much time on that yet)
</preference>
<preference name="AmountofRotation" type="range" defval="30" min="1" max="100">
How much rotation will occur with each Speed tick
</preference>
<preference name="ConstantlyRotate" type="range" defval="0" min="0" max="1">
Keep rotating forever - 0 is false, 1 is true ... Warning, with a high speed setting this can hog CPU as much as 50%
</preference>
<preference name="Speed" type="range" defval="150" min="1" max="300">
Define the speed of the bounce (1 is quick and cpu intensive and 300 is very slow)
</preference>
</preferences>
<images>
</images>
<script engine="vbScript"><![CDATA[
Dim Counter
Dim StartTop, StartLeft
Dim TickRate
Dim isOver
Dim isMounting
'These routines are the optional ones called by the framework
Sub OnCreate()
isOver = false
isMounting = true
TickRate = 100
Counter = 0
Speed.value = 80
ReturnStart = 0
StartRotation = Desklet.Rotation
AmountofRotation = 30
ConstantlyRotate = 0
'And Reading overwrites them with some previous user changes
Preferences.ReadAll()
if ConstantlyRotate = 1 then
StartTop = Desklet.Rotation
isMounting = true
Counter = 0
Ticker.Interval = Speed.value
Ticker.Enabled = True
isOver = true
end if
End Sub
Sub OnMouseOn()
StartTop = Desklet.Rotation
isMounting = true
Counter = 0
Ticker.Interval = Speed.value
Ticker.Enabled = True
isOver = true
End Sub
Sub OnMouseout()
if ConstantlyRotate = 0 Then
isOver = false
Ticker.Enabled = False
if ReturnStart = 1 then
Desklet.Rotation = StartTop
Desklet.Redraw()
End If
End If
End Sub
'Function OnBeforeDraw(IsMouseOn, IsSelected, IsPreview)
'End Function
'Function OnAfterDraw(IsMouseOn, IsSelected, IsPreview)
'End Function
Sub OnSave()
Preferences.SaveAll
End Sub
'Optional. Indicates a preference change
Function OnPreferenceChange(Preference, oldValue, newValue)
if ConstantlyRotate = 1 then
StartTop = Desklet.Rotation
isMounting = true
Counter = 0
Ticker.Interval = Speed.value
Ticker.Enabled = True
isOver = true
else
isOver = false
Ticker.Enabled = False
if ReturnStart = 1 then
Desklet.Rotation = StartTop
End If
Desklet.Redraw()
end if
End Function
'You can only have 1 Ticker per effectlet
'The OnTimer method is shielded against multiple entrance recursion
Sub OnTimer()
if isMounting then
if Counter > 277777 then
Counter = 0
else
Counter = Counter + AmountofRotation
End If
isMounting = true
End If
Desklet.Rotation = StartTop + Counter
Desklet.Redraw()
End Sub
'Optional calls that we don't need for this script:
'Sub OnSelect()
'End Sub
'Sub OnDeselect()
'End Sub
'Sub OnShow()
'End Sub
'Sub OnHide()
'End Sub
'Sub OnConfigure()
'the configuration dialog with default UI for
'XML preferences will be shown.
'An additional dialog designer is on its way. It will
'extend the available default preferences of type:
' - slider, checkbox, combobox (builtin, v. 1.1, free on form with v. 1.2)
' - textbox, file browser, favorites URL (builtin and free on form, v. 1.2)
' - Any ocx (external, only free on form, v. 1.2)
'End Sub
Sub OnStartMove()
if ConstantlyRotate = 0 Then
isOver = false
Ticker.Enabled = False
Desklet.Rotation = StartTop + Counter
End if
End Sub
Sub OnEndMove()
'OnMouseOn
End Sub
Sub OnLeftClick()
Desklet.Rotation = StartTop + Counter
End Sub
'Sub OnRightClick()
'End Sub
'Sub OnDestroy
'End Sub
]]></script>
</effectlet>